var allData = [
  {name: "北京",},
  {name: "天津",},
  {name: "上海",},
  {name: "重庆",},
  {name: "河北",},
  {name: "河南",},
  {name: "云南",},
  {name: "辽宁",},
  {name: "黑龙江",},
  {name: "湖南",},
  {name: "安徽",},
  {name: "山东",},
  {name: "新疆",},
  {name: "江苏",},
  {name: "浙江",},
  {name: "江西",},
  {name: "湖北",},
  {name: "广西",},
  {name: "甘肃",},
  {name: "山西",},
  {name: "内蒙古",},
  {name: "陕西",},
  {name: "吉林",},
  {name: "福建",},
  {name: "贵州",},
  {name: "广东",},
  {name: "青海",},
  {name: "西藏",},
  {name: "四川",},
  {name: "宁夏",},
  {name: "海南",},
  {name: "台湾",},
  {name: "香港",},
  {name: "澳门",},
];
var myChart2 = '';
var this_id = '';

var PAGES = {
	
	//  实例化表格
	init_table:function(t_w){
		layui.use('table', function(){
			var table = layui.table;
			  
			// 已知数据渲染
			var inst = table.render({
				width:t_w,  
				even: true,
				page: {theme:'#C10D26'}, 
				limits: false,
				limit: 13, // 每页默认显示的数量
				elem: '#ID-table-demo-data',
				cols: [[ //标题栏
				  {field: 'id', title: '序号', width: 40,type:'numbers',fixed:"left",align:"center" },
				  {field: 'a1', title: '品牌logo', minWidth: 100,fixed:"left",align:"center",templet: '#TPL-logo'},
				  {field: 'a2', title: '编码', minWidth: 100},
				  {field: 'a3', title: '名称-英文', minWidth: 90},
				  {field: 'a4', title: '名称-中文', minWidth: 90},
				  {field: 'a5', title: '成立时间', minWidth: 80, },
				  {field: 'a6', title: 'PLC开始时间', minWidth: 90, },
				  {field: 'a7', title: '所属国家', minWidth: 80, },
				  {field: 'a8', title: '品牌Slogan', minWidth: 120, },
				  {field: 'a9', title: '在中国公司实体名称', minWidth: 140, },
				  {field: 'a10', title: '中国地区地址', minWidth: 100, },
				  {field: 'a11', title: '网站', minWidth: 140, },
				  {field: 'a12', title: '是否能做代工', minWidth: 100, },
				  {field: 'a13', title: '股票代码', minWidth: 100, },
				  {field: 'a14', title: '评分', minWidth: 80, },
				  {field: 'a15', title: '粉丝数', minWidth: 80, },
				  {field: 'a16', title: '接收邮箱地址', minWidth: 130, },
				  {field: 'a17', title: '品牌介绍', minWidth: 140, },
				]],
				
				data: [
					{"id": "1","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "2","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "3","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "4","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
					{"id": "5","a1": "张三1","a2": "Siemens-PLC-0001","a3": "Siemens","a4": "西门子","a5":"1847年","a6":"1960","a7":"德国","a8":"西门子,不仅是一个产品的名称,更是一种文化。","a9":"西门子（中国）有限公司","a10":"北京","a11":"https://www.siemens.com/cn/zh.html","a12":"-","a13":"1541525","a14":"4.2","a15":"100w+","a16":"1096182557@gmail.com","a17":"暂无"},
				],
				
			});
		  
		  
			 // 行单击事件( 双击事件为: rowDouble )
			table.on('row(ID-table-demo-data)', function(obj){
			    var data = obj.data; // 获取当前行数据
			    // 标注当前点击行的选中状态
			    obj.setRowChecked({
			      type: 'radio' // radio 单选模式；checkbox 复选模式
			    });
				
				window.location.href="../company/index.html"
				
			});
		  
		  
		});
	},
	
	
	wxx_ups:function(){
		layui.use(function(){
		  var upload = layui.upload;
		  var $ = layui.$;
		  // 渲染
		  upload.render({
		    elem: '#ID-upload-demo-drag',
		    url: '', // 实际使用时改成您自己的上传接口即可。
		    done: function(res){
		      layer.msg('上传成功');
		      $('#ID-upload-demo-preview').removeClass('layui-hide')
		      .find('img').attr('src', res.files.file);
		      console.log(res)
		    }
		  });
		});
	},
	
	
	// 分页功能
	wxx_pages:function(){
		layui.use(function(){
		  var laypage = layui.laypage;
		  // 完整显示
		  laypage.render({
		    elem: 'demo-laypage-all', // 元素 id
		    count: 100, // 数据总数
		    layout: [ 'prev', 'page', 'next','skip','count',  ], // 功能布局
			prev: '<em>←</em>',
			next: '<em>→</em>',
		    jump: function(obj){
		      
		    }
		  });
		});
		
	},
	
	//  中国地图
	chinaFun:function(){
	
		
		//各省份的地图json文件
		var provinces = {
		  上海: "../../static/json/310000.json",
		  河北: "../../static/json/130000.json", 
		  山西: "../../static/json/140000.json",
		  内蒙古: "../../static/json/150000.json",
		  辽宁: "../../static/json/210000.json",
		  吉林: "../../static/json/220000.json",
		  黑龙江: "../../static/json/230000.json",
		  江苏: "../../static/json/320000.json",
		  浙江: "../../static/json/330000.json",
		  安徽: "../../static/json/340000.json",
		  福建: "../../static/json/350000.json",
		  江西: "../../static/json/360000.json",
		  山东: "../../static/json/370000.json",
		  河南: "../../static/json/410000.json",
		  湖北: "../../static/json/420000.json",
		  湖南: "../../static/json/430000.json",
		  广东: "../../static/json/440000.json",
		  广西: "../../static/json/450000.json",
		  海南: "../../static/json/460000.json",
		  四川: "../../static/json/510000.json",
		  贵州: "../../static/json/520000.json",
		  云南: "../../static/json/530000.json",
		  西藏: "../../static/json/540000.json",
		  陕西: "../../static/json/610000.json",
		  甘肃: "../../static/json/620000.json",
		  青海: "../../static/json/630000.json",
		  宁夏: "../../static/json/640000.json",
		  新疆: "../../static/json/650000.json",
		  北京: "../../static/json/110000.json",
		  天津: "../../static/json/120000.json",
		  重庆: "../../static/json/500000.json",
		  香港: "../../static/json/810000.json",
		  澳门: "../../static/json/820000.json",
		};
		
	
		for (var i = 0; i < allData.length; i++) {
		  allData[i].value = Math.round(Math.random() * 200);
		}
		
		PAGES.loadMap("../../static/json/all.json", "china"); //初始化全国地图
		
		var timeFn = null;
		
		//单击切换到省级地图，当mapCode有值,说明可以切换到下级地图
		myChart2.on("click", function (params) {
		  clearTimeout(timeFn);
		  //由于单击事件和双击事件冲突，故单击的响应事件延迟250毫秒执行
		  timeFn = setTimeout(function () {
		    var name = params.name; //地区name
		    var mapCode = provinces[name]; //地区的json数据
		    if (!mapCode) {
		      alert("无此区域地图显示");
		      return;
		    }
		
		    PAGES.loadMap(mapCode, name);
		  }, 250);
		});
		
		// 绑定双击事件，返回全国地图
		myChart2.on("dblclick", function (params) {
		  //当双击事件发生时，清除单击事件，仅响应双击事件
		  clearTimeout(timeFn);
		
		  //返回全国地图
		  PAGES.loadMap("../../static/json/all.json", "china");
		});
		
		
	
	},
	
	/**
	 获取对应的json地图数据，然后向echarts注册该区域的地图，最后加载地图信息
	 @params {String} mapCode:json数据的地址
	 @params {String} name: 地图名称
	 */
	loadMap:function(mapCode, name) {
	  $.get(mapCode, function (data) {
		if (data) {
		  echarts.registerMap(name, data);
		  var option = {
			tooltip: {
			  show: true,
			  formatter: function (params) {
				if (params.data) return params.name + "-品牌库：" + params.data["value"];
			  },
			},
			
			visualMap: {
			    show: true,
			    left: 'left',
			    top: 'bottom',
			    seriesIndex: [0],
			    type:'piecewise',
			    pieces:[
			        {min:100,color: '#ef385d'},
			        {min:40, max:100, color: '#f5a71d'},
			        {min:20, max:40, color: '#2fb1c0'},
			        {min:5, max:20, color: '#b1d236'},
			        {min:1, max:5, color: 'rgb(131,175,155)'}
			    ],            
			    textStyle: {
			        color: '#000000'
			    }
			},  
			
			// visualMap: {
			//   type: "continuous",
			//   text: ["", ""],
			//   showLabel: true,
			//   left: "50",
			//   min: 0,
			//   max: 100,
			//   inRange: {
			// 	color: ["#edfbfb", "#b7d6f3", "#40a9ed", "#3598c1", "#215096"],
			//   },
			//   splitNumber: 0,
			// },
			series: [
			  {
				name: "MAP",
				type: "map",
				mapType: name,
				selectedMode: "false", //是否允许选中多个区域
				label: {
				  normal: {
					show: true,
				  },
				  emphasis: {
					show: true,
				  },
				},
				zoom:1.1,//地图放大倍数
				roam: false, //  缩放
				data: allData,
				itemStyle: {
				    normal: {
				        areaColor: '#F6F6F6',
				        borderColor: '#666666',
				    },
				    emphasis: {
				        areaColor: '#C10D26',
				    }
				}
			  },
			],
		  };
		  myChart2.setOption(option);
		  // curMap = {
		  //     mapCode: mapCode,
		  //     mapName: name
		  // };
		} else {
		  alert("无法加载该地图");
		}
	  });
	},
	
	//  世界地图
	wordFun:function(){
		// 基于准备好的dom，初始化echarts实例
		var myChart = echarts.init(document.getElementById('main'));
			
		// 指定图表的配置项和数据
		var name_title = "制造业各国家品牌库"
		var mapName = 'world'
		var data = [
			{ name: 'China', value: 17252 },
			{ name: 'Japan', value: 20 },
			{ name: 'Thailand', value: 19 },
			{ name: 'Singapore', value: 18 },
			{ name: 'Korea', value: 15 },
			{ name: 'Australia', value: 10 },
			{ name: 'United States', value: 50 },
			{ name: 'Germany', value: 10 },
			{ name: 'Malaysia', value: 8 },
			{ name: 'Vietnam', value: 7 },
			{ name: 'France', value: 6 },
			{ name: 'United Arab Emirates', value: 50 },
			{ name: 'Canada', value: 30 },
			{ name: 'India', value: 3 },
			{ name: 'Philippines', value: 2 },
			{ name: 'Italy', value: 2 },
			{ name: 'United Kingdom', value: 2 },
			{ name: 'Russia', value: 70 },
			{ name: 'Nepal', value: 1 },
			{ name: 'Sri Lanka', value: 1 },
			{ name: 'Finland', value: 1 },
			{ name: 'Sweden', value: 1 },
			{ name: 'Cambodia', value: 1 },
		];
		
		var option = {
		    title: {
		        text: '',
		        x: 'center',
		        textStyle: {
		            fontSize: 24
		        },                
		    },
		    tooltip: {
		        trigger: 'item',
		        formatter: function(params) {                        
		                var toolTiphtml = ''
						if (isNaN(params.value)){
							toolTiphtml = params.name + '品牌库: 0';
		                }
						else{
							toolTiphtml = params.name + '品牌库: ' + params.value;
		                }
						//console.log(toolTiphtml)                        
		                return toolTiphtml;                   
		        }
		    },
		    toolbox: {
		        feature: {
		            saveAsImage: {}
		        }
		    },
			// 图例 
		    visualMap: {
		        show: true,
		        left: 'left',
		        top: 'bottom',
		        seriesIndex: [0],
		        type:'piecewise',
		        pieces:[
		            {min:100, color: '#ef385d'},
		            {min:40, max:100, color: '#f5a71d'},
		            {min:20, max:40, color: '#2fb1c0'},
		            {min:5, max:20, color: '#b1d236'},
		            {min:1, max:5, color: 'rgb(131,175,155)'}
		        ],            
		        textStyle: {
		            color: '#000000'
		        }
		    },            
		    geo: {
		        show: true,
		        map: mapName,
		        label: {
		            normal: {
		                show: false,
		                fontSize:12,
		            },
		            emphasis: {
		                show: false,
		            }
		        },
				zoom:1.1,//地图放大倍数
		        roam: false, //  缩放
		        itemStyle: {
		            normal: {
		                areaColor: '#F6F6F6',
		                borderColor: '#666666',
		            },
		            emphasis: {
		                areaColor: '#C10D26',
		            }
		        }
		    },
		    series: [
		        {
		            type: 'map',
		            map: mapName,
		            geoIndex: 0,           
		            animation: false,
		            data: data,
					
		        },
		    ]
		};
			
		// 使用刚指定的配置项和数据显示图表。
		myChart.setOption(option);
	}
	
	
	
}

var t_w = $('.p_tables_view').innerWidth()
if(t_w){
	PAGES.init_table(t_w);
}


if($('#wxx_ups').length){
	PAGES.wxx_ups();
}

$('.p_nav_items').click(function(){
	var  type = $(this).attr('data-type')
	$('.p_nav_items').removeClass('active');
	$(this).addClass('active');
	$('.hide').hide();
	$('.p_show_b'+type).show()
	
	switch (type*1){
		case 2:
			PAGES.wxx_pages();
			break;
		case 3:
			setTimeout(function(){
				myChart2 = echarts.init(document.getElementById('all'))
				PAGES.chinaFun();
			},100)
			break;
		case 4:
			PAGES.wordFun();
			break;
	}
	
})



